package demo2;

import demo1.Cat;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-05-15
 * Time: 20:27
 */

class Base {
   public int a = 1;
   public int b = 2;

   public void testA() {
       System.out.println("father.class");
   }
}

class Derived extends Base {
    public int c = 3;
    public int a = 9;

    public void print() {
        System.out.print(this.a + " " + super.b + " " + this.c);
        System.out.println( " " + super.a);
    }

    public void testA() {
        System.out.println("son.class");
    }

    public void test() {
        testA();
        super.testA();
    }

    public static void main(String[] args) {

    }
}
public class Test {
    public static void main(String[] args) {
        Derived derived = new Derived();
//        derived.print();

        derived.test();
    }
}
